package svc

import (
	"charging_pile/netty/internal/config"
	"charging_pile/netty/internal/def"

	"github.com/zeromicro/go-zero/core/netx"
)

type ServiceContext struct {
	Config     config.Config
	Ip         string
	MqAddr     string
	LocalTopic string
	MQ         def.HandNettyMsg
	Netty      def.HandleMqMsg
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:     c,
		Ip:         netx.InternalIp(),
		MqAddr:     c.MqAddr,
		LocalTopic: netx.InternalIp() + c.NettyAddr,
	}
}
